package com.itlong.cloud.project.property;

import com.itlong.cloud.POJO.DTO.property.PropertyRuleGetDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyFeeRuleDTO;
import com.itlong.cloud.POJO.VO.property.PropertyRuleDetailVO;
import com.itlong.cloud.POJO.VO.property.PropertyRuleVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <desc>
 *      收费管理服务接口协议提供对象
 * </desc>
 *
 * @createDate 2018-08-09
 */
@FeignClient(name = "project-service")
public interface IPropertyRuleServiceClient {

    /**
     * <desc>
     *     分页查询收费规则
     * <desc/>
     *
     * @param  propertyRuleGetDTO  分页查询收费规则记录
     * @return  MessageVO 标准格式化响应结果
     * @author Qiang.S
     * @createDate 2018/08/09
     */
    @PostMapping(path = "/expenses/rule/getRuleByPage")
    Page<PropertyRuleVO> getRuleByPage(@RequestBody PropertyRuleGetDTO propertyRuleGetDTO) throws Exception;

    /**
     * <desc>
     *      根据收费类型查询收费规则
     * <desc/>
     *
     * @param projectId 项目编号
     * @param feeType 收费类型：1抄表费 2物业费 3维修费 4停车费
     * @param feeCycle 收费周期：1月 2季度 3年
     * @return MessageVO 标准格式化响应结果
     * @author Qiang.S
     * @createDate 2018/08/15
     */
    @PostMapping(path = "/expenses/rule/getRuleByFeeType")
    List<PropertyRuleVO> getRuleByFeeType(@RequestParam("projectId") String projectId,
                                          @RequestParam("feeType") String feeType,
                                          @RequestParam("feeCycle") String feeCycle) throws Exception;

    /**
     * <desc>
     *     查询收费规则详情
     * <desc/>
     *
     * @param  feeRuleId  分页查询收费规则记录
     *  @param  projectId  项目编号
     * @return  MessageVO 标准格式化响应结果
     * @author Qiang.S
     * @createDate 2018/08/09
     */
    @PostMapping(path = "/expenses/rule/getRuleDetail")
    PropertyRuleDetailVO getRuleDetail(@RequestParam("feeRuleId") String feeRuleId, @RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     *     新增收费规则
     * <desc/>
     *
     * @param  propertyFeeRuleDTO  收费规则信息
     * @return  MessageVO 标准格式化响应结果
     * @author Qiang.S
     * @createDate 2018/08/09
     */
    @PostMapping(path = "/expenses/rule/saveRule")
    Integer saveRule(@RequestBody PropertyFeeRuleDTO propertyFeeRuleDTO) throws Exception;

    /**
     * <desc>
     *     判断规则名称是否重复
     * <desc/>
     *
     * @param  ruleName  收费规则名称
     * @param  projectId  项目编号
     * @param  feeRuleId  收费规则ID
     * @return  MessageVO 标准格式化响应结果
     * @author Qiang.S
     * @createDate 2018/10/24
     */
    @PostMapping(path = "/expenses/rule/checkRuleNameRepeat")
    Integer checkRuleNameRepeat(@RequestParam("ruleName") String ruleName, @RequestParam("projectId") String projectId, @RequestParam(value = "feeRuleId",required = false) String feeRuleId) throws Exception;

    /**
     * <desc>
     *     更新收费规则
     * <desc/>
     *
     * @param  propertyFeeRuleDTO  收费规则信息
     * @return  MessageVO 标准格式化响应结果
     * @author Qiang.S
     * @createDate 2018/08/09
     */
    @PostMapping(path = "/expenses/rule/updateRule")
    Integer updateRule(@RequestBody PropertyFeeRuleDTO propertyFeeRuleDTO) throws Exception;

    /**
     * <desc>
     *     删除收费规则
     * <desc/>
     *
     * @param  feeRuleId 收费规则ID
     * @return  MessageVO 标准格式化响应结果
     * @author Qiang.S
     * @createDate 2018/08/09
     */
    @PostMapping(path = "/expenses/rule/deleteRule")
    Integer deleteRule(@RequestParam("feeRuleId") String feeRuleId) throws Exception;

    /**
     * <desc>
     *     查询收费规则是否被绑定
     * <desc/>
     *
     * @param  feeRuleId 收费规则ID
     * @return  MessageVO 标准格式化响应结果
     * @author Qiang.S
     * @createDate 2018/09/03
     */
    @PostMapping(path = "/expenses/rule/deleteRuleCheck")
    Integer deleteRuleCheck(@RequestParam("feeRuleId") String feeRuleId) throws Exception;

    /**
     * <desc>
     *     根据账单编号获取最小收费日
     * <desc/>
     *
     * @param  feeId 账单编号
     * @return  MessageVO 标准格式化响应结果
     * @author Qiang.S
     * @createDate 2018/10/25
     */
    @PostMapping(path = "/expenses/rule/getMinFeeDay")
    String getMinFeeDay(@RequestParam("feeId") String feeId) throws Exception;
}
